package it.multisystem.gettingstarted;

public class NotOOGeometry {

	public static double calculateDistance(double x1, double y1, double x2, double y2) {
		double dx = x1 - x2;
		double dy = y2 - y1;
		
		return Math.sqrt(dx * dx + dy * dy);
	}

	public static boolean areAligned(double x1, double y1, double x2, double y2, double x3, double y3) {
		double dx = x1 - x2;
		double dy = y1 - y2;
		double m = dy / dx;
		double q = y1 - m * x1;
		
		return Math.abs(m * x3 + q - y3) < 0.00001;
	}

}
